That means the whole hierarchy is getting destroyed, leaving those
behind incurs not only in a leak, but also on weak refs (and unintended
repick) to happen in the wrong moment.
GtkWindow *window = GTK_WINDOW (object);
GtkWindowPrivate *priv = window->priv;
+ g_list_free_full (priv->foci, (GDestroyNotify) gtk_pointer_focus_unref);
+ priv->foci = NULL;
+
gtk_window_set_focus (window, NULL);
gtk_window_set_default (window, NULL);
remove_attach_widget (window);